
package com.wwy.monitor.mapper.tddl;

import com.wwy.monitor.model.tddl.dto.MonitorConfigDetailDTO;
import com.wwy.monitor.model.tddl.query.MonitorConfigDetailQuery;
import com.wwy.monitor.model.tddl.vo.MonitorConfigDetailVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author tianquan.ld
 * @version V1.0
 * <p>Description: çæ§配置详情 mapper</p>
 * @date 2019-10-29 15:59
 */
@Repository
public interface MonitorConfigDetailMapper {
    /**
     * æ°å»º
     *
     * @param entity
     * @return
     */
    int insert(MonitorConfigDetailDTO entity);

    /**
     * å é¤
     *
     * @param id
     * @return
     */
    int deleteById(@Param("id") Long id);

    /**
     * æ ¹æ®åºç¨idé»è¾å é¤éç½®è¯¦æ
     *
     * @param appId åºç¨id
     * @return é»è¾å é¤æ¡æ°
     */
    int deleteByAppId(@Param("appId") Long appId);

    /**
     * æ´æ°
     *
     * @param entity
     * @return
     */
    int updateById(MonitorConfigDetailDTO entity);

    /**
     * æ ¹æ®åºç¨idä¸çº¿ææéç½®è¯¦æ
     *
     * @param appId åºç¨id
     * @return ä¸çº¿éç½®è¯¦ææ¡æ°
     */
    int offlineConfigDetailByAppId(Long appId);

    /**
     * æ¥è¯¢è§åï¼åé¡µï¼
     *
     * @return
     */
    List<MonitorConfigDetailVo> selectByQuery(MonitorConfigDetailQuery query);

    /**
     * æ ¹æ®idå³èæ¥è¯¢åºç¨ç¶æ
     *
     * @param id ä¸»é®
     * @return
     */
    Integer selectAppStatusById(@Param("id") Long id);

    /**
     * æ ¹æ®åºç¨idæ¥è¯¢ææéç½®è¯¦æ
     *
     * @param query
     * @return é ç½®è¯¦æéå
     */
    List<MonitorConfigDetailDTO> selectByCondition(MonitorConfigDetailQuery query);

    /**
     * æ ¹æ®idæ¥è¯¢
     *
     * @param id
     * @return
     */
    MonitorConfigDetailDTO selectById(@Param("id") Long id);

    /**
     * æ ¹æ®idéåãåºç¨idæ¥è¯¢éç½®è¯¦æ
     *
     * @param appId åºç¨id
     * @param list  éç½®è¯¦æidéå
     * @return é ç½®è¯¦ææ°æ®
     */
    List<MonitorConfigDetailVo> selectByAppIdAndIds(@Param("appId") Long appId, @Param("list") List<Long> list);

    /**
     * æ»æ°
     *
     * @param query
     * @return
     */
    Integer count(MonitorConfigDetailQuery query);

    /**
     * æ ¹æ®çæ§ç±»ååé¢æ¬¡ï¼è·åçæ§配置详情ä¿¡æ¯
     *
     * @param query
     * @return
     */
    List<MonitorConfigDetailVo> findAllByConfigQuery(MonitorConfigDetailQuery query);

    /**
     * æ ¹æ®éç½®è¯¦æidï¼è·åçæ§配置详情ä¿¡æ¯
     *
     * @param detailId éç½®è¯¦æid
     * @return é ç½®è¯¦æä¿¡æ¯
     */
    MonitorConfigDetailVo findById(Long detailId);

    int updateBatchMonitorTime(@Param("list") List<MonitorConfigDetailVo> list);

    int selectCountByDetailName(@Param("id") Long id, @Param("appId") Long appId, @Param("detailName") String detailName);

    /**
     * æ´æ°
     *
     * @param entity
     * @return
     */
    int updateDelayTimeById(MonitorConfigDetailDTO entity);
}